package com.eboss.sbs.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.ListView;

import com.eboss.sbs.R;
import com.eboss.sbs.activity.base.BaseActivity;
import com.eboss.sbs.adapter.RateInfoListAdapter;
import com.eboss.sbs.model.RateInfoEntity;

import java.util.ArrayList;
import java.util.List;

public class RateInfoActivity extends BaseActivity {

	private ListView listview;
	private RateInfoListAdapter adapter;
	private List<RateInfoEntity> datas;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		mActivity = this;
		setContentView(R.layout.activity_rate_info);
		super.onCreate(savedInstanceState);
		initView();
	}
	
	private void initView(){
		showView(R.id.titleback_btn_back, true);
		setTvText(R.id.tv_title, "收款额度与费率 ");
		
		datas = new ArrayList<RateInfoEntity>();
		listview = (ListView)findViewById(R.id.listview);
		adapter = new RateInfoListAdapter(this, datas);
		
		findViewById(R.id.titleback_btn_back).setOnClickListener(this);
		
		listview.setAdapter(adapter);
		
		getdata();
		
	}
	
	private void getdata(){
		
		datas.add(new RateInfoEntity(6, 56, "20000元", "T+1", "1.信用卡单日单笔200元\n2.借记卡单日单笔10000元\n3.账户余额、余额宝不限"));
		datas.add(new RateInfoEntity(7, 28, "3000元", "T+1", "1.信用卡单日单笔100元\n2.借记卡单日单笔20000元\n3.账户余额、余额宝不限"));
		datas.add(new RateInfoEntity(1, 10, "10000元", "实时到帐", "1.信用卡单日单笔300元\n2.借记卡单日单笔2000元\n3.账户余额、余额宝不限"));
		datas.add(new RateInfoEntity(3, 8, "5000元", "实时到帐", "1.信用卡单日单笔500元\n2.借记卡单日单笔5000元\n3.账户余额、余额宝不限"));
		
		adapter.notifyDataSetChanged();
	}
	
	@Override
	public void onClick(View v) {
		switch (v.getId()) {
			case R.id.titleback_btn_back:
				finish();
				break;
	
			default:break;
		}
		super.onClick(v);
	}
	
}
